﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Collections.ObjectModel;
using System.ComponentModel;

namespace DataModels
{
    public class Report
    {
        public string AType { get; set; }
        public decimal SumOfAmount { get; set; }
    }

    public class ReportType
    {

        public int Id { get; set; }
        public string Description { get; set; }

        public ReportType()
        {

        }

        public ReportType(int id, string Description)
        {
            this.Id = id;
            this.Description = Description;
        }
    }

    public class DataTypeBulk
    {
        public ObservableCollection<UserType> UserTypesData { get; set; }
        public ObservableCollection<ActionType> ActionIncomeTypesData { get; set; }
        public ObservableCollection<ActionType> ActionOutcomeTypesData { get; set; }
        public ObservableCollection<ReportType> ReportTypesData { get; set; }

    }

    partial class User : IDataErrorInfo
    {
        [DataMember]
        public ObservableCollection<Income> Incomes1 { get; set; }

        [DataMember]
        public ObservableCollection<Outcome> Outcomes1 { get; set; }

        public string Error
        {
            get { throw new NotImplementedException(); }
           // get { return "Error Occured"; }
        }

        public string this[string columnName]
        {
            get
            {
                string result = null;
                if (columnName == "Username")
                {
                    if ( String.IsNullOrEmpty(Username.Trim()))
                    {
                        result = "Please enter user name!";
                    }
                }

                if (columnName == "Password")
                {
                    if (Password.Length < 3)
                    {
                        result = "Password must be more than 3 Chars";
                    }
                }

                return result;
            }
        }
    

    }

    public class ReportMessage
    {

        /// <summary>
        /// default ctor for serialization
        /// </summary>
        public ReportMessage()
        {
        }

        /// <summary>
        /// for neater init
        /// </summary>
        /// <param name="username"></param>
        /// <param name="dateFrom"></param>
        /// <param name="dateTo"></param>
        public ReportMessage(string username, DateTime dateFrom, DateTime dateTo)
        {
            Username = username;
            DateFrom = dateFrom;
            DateTo = dateTo;
        }


        public string Username { get; set; }
        public DateTime DateFrom { get; set; }
        public DateTime DateTo { get; set; }
    }

}
